import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  
   {
    title: '分组名称',
    align:"center",
    dataIndex: 'groupName',
    width:150
   },
   {
    title: '描述',
    align:"center",
    dataIndex: 'groupDesc',
    width:200
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime',
    width:150
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "分组名称",
      field: 'groupName',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
export const groupPersonSearchFormSchema: FormSchema[] = [
  {
    label: "学/工号",
    field: 'code',
    component: 'Input',
    //colProps: {span: 6},
},
{
    label: "姓名",
    field: 'name',
    component: 'Input',
    //colProps: {span: 6},
},
{
      label: "分组",
      field: 'groupId',
      component: 'JSearchSelect',
      componentProps: {
        dict: 'ac_group,group_name,id',
      },
      //colProps: {span: 6},
 	},
{
 label: '所在部门',
 field: 'departmentId',
 component: 'JSelectDept',
 componentProps:{
   multiple:false,
   checkable:false,
 }
},
	
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '分组名称',
    field: 'groupName',
    component: 'Input',
    componentProps:{
      maxlength:30
    },
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请输入分组名称!'},
      ];
 },
  },
  {
    label: '描述',
    field: 'groupDesc',
    component: 'Input',
    componentProps:{
      maxlength:50
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//分组人员列表
export const acPersonGroupColumns:BasicColumn[] = [
  {
   title: '学/工号',
   align:"center",
   dataIndex: 'code',
  },
  {
   title: '姓名',
   align:"center",
   dataIndex: 'name',
  },
  {
   title: '部门',
   align:"center",
   dataIndex: 'departmentId_dictText',
   width:200
  },
  {
    title:"通行分组",
    align:"center",
    dataIndex: 'groupName_dictText',
  },
  
];
//查询
export const acPersonGroupSearchFormSchema: FormSchema[] = [
  {
      label: "学/工号",
      field: 'code',
      component: 'Input',
      //colProps: {span: 6},
  },
  {
      label: "姓名",
      field: 'name',
      component: 'Input',
      //colProps: {span: 6},
  },
 {
   label: '所在部门',
   field: 'departmentId',
   component: 'JSelectDept',
   componentProps:{
     multiple:false,
     checkable:false,
   }
 },
  
  
];

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
